@extends('admin::layouts.master')

@section('title')用户管理@endsection

@section('css')

@endsection

@section('nav')
    <div class="row mb-2">
        <div class="col-sm-6">
            <h1 class="m-0">配置管理</h1>
        </div>
        <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
                <li class="breadcrumb-item"><a href="{{route('admin.configuration')}}">配置管理</a></li>
                <li class="breadcrumb-item active">新建配置</li>
            </ol>
        </div>
    </div>

@endsection

@section('content')
    <div class="card">
        <div class="card-body">
            <form class="form-horizontal" action="{{route('admin.configuration.store')}}" method="POST">
                {{csrf_field()}}
                <div class="form-group row">
                    <label for="group" class="col-sm-2 col-form-label">配置组</label>
                    <div class="col-sm-5">
                        <select id="group" name="group_id" class="form-control">
                            <option value="">请选择...</option>
                            @foreach($groups as $group)
                                <option value="{{$group->id}}">{{$group->name}}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
                <div class="form-group row">
                    <label for="type" class="col-sm-2 col-form-label">类型</label>
                    <div class="col-sm-5">
                        <select name="type" id="type" class="form-control">
                            <option value="input">输入框</option>
                            <option value="textarea">文本域</option>
                            <option value="radio">单选</option>
                            <option value="select">下拉</option>
                        </select>
                    </div>
                </div>

                <div class="form-group row">
                    <label for="label" class="col-sm-2 col-form-label">名称</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" maxlength="16" id="label" name="label" value="{{old('label')}}" placeholder="配置名称">
                    </div>
                </div>

                <div class="form-group row">
                    <label for="key" class="col-sm-2 col-form-label">键名</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" maxlength="16" id="key" name="key" value="{{old('key')}}" placeholder="配置键名">
                    </div>
                </div>

                <div class="form-group row">
                    <label for="value" class="col-sm-2 col-form-label">配置默认值</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" maxlength="16" id="val" name="val" value="{{old('val')}}" placeholder="配置键值">
                    </div>
                </div>

                <div class="form-group row">
                    <label for="tips" class="col-sm-2 col-form-label">提示语</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" maxlength="16" id="tips" name="tips" value="{{old('tips')}}" placeholder="提示语">
                    </div>
                </div>

                <div class="form-group row">
                    <label for="sort" class="col-sm-2 col-form-label">排序号</label>
                    <div class="col-sm-5">
                        <input type="number" class="form-control" maxlength="16" id="sort" name="sort" value="{{old('sort')}}" placeholder="排序号">
                    </div>
                </div>

                <div class="col-sm-7" style="text-align: center;">
                    <button type="submit" class="btn btn-info">提 交</button>
                    <a class="btn btn-default" href="{{route('admin.configuration')}}">返 回</a>
                </div>
            </form>
        </div>
    </div>
@endsection